import { useIntersectionObserver } from '@vueuse/core'
import { ref } from 'vue'
import { userMobileLoginMsg } from '@/api/user.js'
export const useLazyData = (apiFn) => {
  const goods = ref([])
  const target = ref(null)
  const { stop } = useIntersectionObserver(
    target,
    ([{ isIntersecting }]) => {
      if (isIntersecting) {
        stop()
        apiFn().then(data => {
          goods.value = data.result
        })
      }
    }
  )
  return { target, goods }
}
export const useCountDown = async (mobile) => {
  const res = await userMobileLoginMsg(mobile)
  console.log(res)
}
export const login = () => {

}
